package mi.payment.settings;

import java.io.Serializable;

import mi.payment.BuildConfig;
import mi.payment.constants.Configs;

/**
 * 签购单打印设置
 *
 * @author sunmi on 2017/2/16.
 */
public class SalesSlipPrintSettings implements Serializable {

    // 使用原有UID，多出来了两个int值，但是默认值均无需适配
    private static final long serialVersionUID = -2464052123719738651L;

    private int rise = 2;                                             // 打印抬头 0.输入; 1.默认文字; 2.银联logo（默认）
    private String hotLine = Configs.getInstance().SERVICE_HOT_LINE();            // 输入热线号码
    private String riseString;                                        // 签购单抬头 根据rise判断设置默认值
    private boolean scanCodePrint = true;                             // 扫码类交易打印凭条
    private boolean printChannelInfo = true;                          // 是否打印渠道信息
    private int selectSalesSlipFont = 0;                              // 签购单字号设置  0.小（签购单小票短） 1.大（签购单大票长）
    private int scanCodeSalesSlip = Configs.getInstance().IS_NEED_PRINT_SECOND(); // 扫码类签购单设置  1.仅打印商户联   2.打印商户联与用户联

    private String printReceiptSingleNum = Configs.getInstance().PRINT_RECEIPT_SINGLE_NUM();          // 打印凭条单联数
    private boolean acquiringBankPrintChinese = Configs.getInstance().ACQUIRING_BANK_PRINT_CHINESE(); // 收单行打印中文
    private boolean issuingBankPrintChinese = Configs.getInstance().ISSUING_BANK_PRINT_CHINESE();     // 发卡行打印中文
    private boolean salesSlipPrintEnglish = Configs.getInstance().SALES_SLIP_PRINT_ENGLISH();         // 签购单是否打印英文
    private boolean isPrintSubtitle = Configs.getInstance().IS_PRINT_SUBTITLE();//是否打印副标题

    public boolean isPrintSubtitle() {
        return isPrintSubtitle;
    }

    public void setPrintSubtitle(boolean printSubtitle) {
        isPrintSubtitle = printSubtitle;
    }

    @Override
    public String toString() {
        return "SalesSlipPrintSettings{" +
                "rise=" + rise +
                ", hotLine='" + hotLine + '\'' +
                ", riseString='" + riseString + '\'' +
                ", scanCodePrint=" + scanCodePrint +
                ", printChannelInfo=" + printChannelInfo +
                ", selectSalesSlipFont=" + selectSalesSlipFont +
                ", scanCodeSalesSlip=" + scanCodeSalesSlip +
                ", printReceiptSingleNum='" + printReceiptSingleNum + '\'' +
                ", acquiringBankPrintChinese=" + acquiringBankPrintChinese +
                ", issuingBankPrintChinese=" + issuingBankPrintChinese +
                ", salesSlipPrintEnglish=" + salesSlipPrintEnglish +
                '}';
    }

    public String getPrintReceiptSingleNum() {
        if (printReceiptSingleNum == null) {
            printReceiptSingleNum = Configs.getInstance().PRINT_RECEIPT_SINGLE_NUM();
        }
        return printReceiptSingleNum;
    }

    protected void setPrintReceiptSingleNum(String printReceiptSingleNum) {
        this.printReceiptSingleNum = printReceiptSingleNum;
    }

    public boolean isAcquiringBankPrintChinese() {
        return acquiringBankPrintChinese;
    }

    protected void setAcquiringBankPrintChinese(boolean acquiringBankPrintChinese) {
        this.acquiringBankPrintChinese = acquiringBankPrintChinese;
    }

    public boolean issuingBankPrintChinese() {
        return issuingBankPrintChinese;
    }

    protected void setIssuingBankPrintChinese(boolean issuingBankPrintChinese) {
        this.issuingBankPrintChinese = issuingBankPrintChinese;
    }

    public boolean isSalesSlipPrintEnglish() {
        return salesSlipPrintEnglish;
    }

    protected void setSalesSlipPrintEnglish(boolean salesSlipPrintEnglish) {
        this.salesSlipPrintEnglish = salesSlipPrintEnglish;
    }

    public String getRiseString() {
        return riseString;
    }

    protected void setRiseString(String riseString) {
        this.riseString = riseString;
    }

    public static final String SALES_SLIP_PRINT_SETTINGS_KEY = "SALES_SLIP_PRINT_SETTINGS_KEY";


    public int getRise() {
        return rise;
    }

    protected void setRise(int rise) {
        this.rise = rise;
    }

    public String getHotLine() {
        return hotLine;
    }

    protected void setHotLine(String hotLine) {
        this.hotLine = hotLine;
    }

    public boolean isScanCodePrint() {
        return scanCodePrint;
    }

    protected void setScanCodePrint(boolean scanCodePrint) {
        this.scanCodePrint = scanCodePrint;
    }

    public boolean isPrintChannelInfo() {
        return printChannelInfo;
    }

    protected void setPrintChannelInfo(boolean printChannelInfo) {
        this.printChannelInfo = printChannelInfo;
    }

    public int getSelectSalesSlipFont() {
        return selectSalesSlipFont;
    }

    protected void setSelectSalesSlipFont(int selectSalesSlipFont) {
        this.selectSalesSlipFont = selectSalesSlipFont;
    }

    public int getScanCodeSalesSlip() {
        if (scanCodeSalesSlip == 0) {
            scanCodeSalesSlip = Configs.getInstance().IS_NEED_PRINT_SECOND();
        }
        return scanCodeSalesSlip;
    }

    protected void setScanCodeSalesSlip(int scanCodeSalesSlip) {
        this.scanCodeSalesSlip = scanCodeSalesSlip;
    }
}
